package com.ruoyi.system.enums;

import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * @author ChenLong
 */
public enum AuditStatusEnum {

    /**
     * 待审核
     **/
    AUDIT_STATUS_PRE(0,"待审核"),

    /**
     * 通过
     **/
    AUDIT_STATUS_PASS(1,"通过"),

    /**
     * 未通过
     **/
    AUDIT_STATUS_NO_PASS(2,"未通过"),

    /**
     * 作废
     **/
    AUDIT_STATUS_NO_USE(3,"作废");

    private Integer key;
    private String value;

    private AuditStatusEnum(Integer key, String value) {
        this.key = key;
        this.value = value;
    }

    public static Map<String, String> getAbandonReasonMap() {
        return (Map) Arrays.stream(values()).collect(Collectors.toMap(AuditStatusEnum::getKey, AuditStatusEnum::getValue));
    }

    public static String getValueByKey(Integer key) {
        AuditStatusEnum[] enums = values();
        for (AuditStatusEnum theEnum : enums) {
            if (theEnum.getKey().equals(key)) {
                return theEnum.getValue();
            }
        }
        return null;
    }

    public Integer getKey() {
        return key;
    }

    public void setKey(Integer key) {
        this.key = key;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }
}
